﻿using System;
using System.Collections.Generic;
using System.Text;
using NHibernate;
using NHibernate.Expression;
using Castle.ActiveRecord;
using Castle.Components.Validator;
using System.ComponentModel;
using Castle.ActiveRecord.Queries;
namespace Mang24k99.Model.PUBC
{
    [ActiveRecord(Table = "KT_PUBC_VOTE_History")]
    public partial class MKtPubcVoteHistory : ActiveRecordBase
    {
        /// <summary>
        /// Deleteses the specified where.
        /// </summary>
        /// <param name="where">The where.</param>
        public static void Deletes(string where)
        {
            DeleteAll(typeof(MKtPubcVoteHistory), where);
        }
        /// <summary>
        /// Deleteses the specified pk values.
        /// </summary>
        /// <param name="pkValues">The pk values.</param>
        public static void Deletes(System.Collections.IEnumerable pkValues)
        {
            DeleteAll(typeof(MKtPubcVoteHistory), pkValues);
        }

        /// <summary>
        /// Selects all.
        /// </summary>
        /// <returns></returns>
        public static IList<MKtPubcVoteHistory> SelectAll()
        {
            return (IList<MKtPubcVoteHistory>)FindAll(typeof(MKtPubcVoteHistory));
        }
        /// <summary>
        /// Selects all.
        /// </summary>
        /// <param name="criteria">The criteria.</param>
        /// <returns></returns>
        public static IList<MKtPubcVoteHistory> SelectAll(params ICriterion[] criteria)
        {
            return (IList<MKtPubcVoteHistory>)FindAll(typeof(MKtPubcVoteHistory), criteria);
        }
        /// <summary>
        /// Selects all.
        /// </summary>
        /// <param name="orders">The orders.</param>
        /// <param name="criteria">The criteria.</param>
        /// <returns></returns>
        public static IList<MKtPubcVoteHistory> SelectAll(Order[] orders, params ICriterion[] criteria)
        {
            return (IList<MKtPubcVoteHistory>)FindAll(typeof(MKtPubcVoteHistory), orders, criteria);
        }
        /// <summary>
        /// Selects all.
        /// </summary>
        /// <param name="detachedCriteria">The detached criteria.</param>
        /// <param name="orders">The orders.</param>
        /// <returns></returns>
        public static IList<MKtPubcVoteHistory> SelectAll(DetachedCriteria detachedCriteria, params Order[] orders)
        {
            return (IList<MKtPubcVoteHistory>)FindAll(typeof(MKtPubcVoteHistory), detachedCriteria, orders);
        }


        /// <summary>
        /// Selects all query.
        /// </summary>
        /// <param name="query">The query.</param>
        /// <returns></returns>
        [DataObjectMethod(DataObjectMethodType.Select)]
        public static IList<MKtPubcVoteHistory> SelectAllQuery(SimpleQuery query)
        {
            return (IList<MKtPubcVoteHistory>)ExecuteQuery(query);
        }


        /// <summary>
        /// Selects the by primary key.
        /// </summary>
        /// <param name="ID">The ID.</param>
        /// <returns></returns>
        public static MKtPubcVoteHistory SelectByPrimaryKey(object ID)
        {
            return (MKtPubcVoteHistory)FindByPrimaryKey(typeof(MKtPubcVoteHistory), ID, false);
        }

        /// <summary>
        /// Selects the by primary key.
        /// </summary>
        /// <param name="ID">The ID.</param>
        /// <returns></returns>
        public static MKtPubcVoteHistory SelectOne(DetachedCriteria detachedCriteria)
        {
            return (MKtPubcVoteHistory)FindOne(typeof(MKtPubcVoteHistory), detachedCriteria);
        }
        /// <summary>
        /// Selects the one.
        /// </summary>
        /// <param name="criteria">The criteria.</param>
        /// <returns></returns>
        public static MKtPubcVoteHistory SelectOne(params ICriterion[] criteria)
        {
            return (MKtPubcVoteHistory)FindOne(typeof(MKtPubcVoteHistory), criteria);
        }

        /// <summary>
        /// Selects the first.
        /// </summary>
        /// <param name="criteria">The criteria.</param>
        /// <returns></returns>
        public static MKtPubcVoteHistory SelectFirst(params ICriterion[] criteria)
        {
            return (MKtPubcVoteHistory)FindFirst(typeof(MKtPubcVoteHistory), criteria);
        }
        /// <summary>
        /// Selects the first.
        /// </summary>
        /// <param name="orders">The orders.</param>
        /// <param name="criteria">The criteria.</param>
        /// <returns></returns>
        public static MKtPubcVoteHistory SelectFirst(Order[] orders, params ICriterion[] criteria)
        {
            return (MKtPubcVoteHistory)FindFirst(typeof(MKtPubcVoteHistory), orders, criteria);
        }
        /// <summary>
        /// Selects the first.
        /// </summary>
        /// <param name="detachedCriteria">The detached criteria.</param>
        /// <param name="orders">The orders.</param>
        /// <returns></returns>
        public static MKtPubcVoteHistory SelectFirst(DetachedCriteria detachedCriteria, Order[] orders)
        {
            return (MKtPubcVoteHistory)FindFirst(typeof(MKtPubcVoteHistory), detachedCriteria, orders);

        }

        /// <summary>
        /// Selects the ALL by property.
        /// </summary>
        /// <param name="property">The property.</param>
        /// <param name="value">The value.</param>
        /// <returns></returns>
        public static IList<MKtPubcVoteHistory> SelectALLByProperty(string property, object value)
        {
            return (IList<MKtPubcVoteHistory>)FindAllByProperty(typeof(MKtPubcVoteHistory), property, value);
        }
        /// <summary>
        /// Selects the ALL by property.
        /// </summary>
        /// <param name="orderByColumn">The order by column.</param>
        /// <param name="property">The property.</param>
        /// <param name="value">The value.</param>
        /// <returns></returns>
        public static IList<MKtPubcVoteHistory> SelectALLByProperty(string orderByColumn, string property, object value)
        {
            return (IList<MKtPubcVoteHistory>)FindAllByProperty(typeof(MKtPubcVoteHistory), orderByColumn, property, value);
        }

        /// <summary>
        /// Selects the ALL sliced.
        /// </summary>
        /// <param name="firstResult">The first result.</param>
        /// <param name="maxResult">The max result.</param>
        /// <param name="detachedCriteria">The detached criteria.</param>
        /// <returns></returns>
        public static IList<MKtPubcVoteHistory> SelectALLSliced(int firstResult, int maxResult, DetachedCriteria detachedCriteria)
        {
            return (IList<MKtPubcVoteHistory>)SlicedFindAll(typeof(MKtPubcVoteHistory), firstResult, maxResult, detachedCriteria);
        }
        /// <summary>
        /// Selects the ALL sliced.
        /// </summary>
        /// <param name="firstResult">The first result.</param>
        /// <param name="maxResult">The max result.</param>
        /// <param name="criteria">The criteria.</param>
        /// <returns></returns>
        public static IList<MKtPubcVoteHistory> SelectALLSliced(int firstResult, int maxResult, params ICriterion[] criteria)
        {
            return (IList<MKtPubcVoteHistory>)SlicedFindAll(typeof(MKtPubcVoteHistory), firstResult, maxResult, criteria);
        }
        /// <summary>
        /// Selects the ALL sliced.
        /// </summary>
        /// <param name="firstResult">The first result.</param>
        /// <param name="maxResult">The max result.</param>
        /// <param name="orders">The orders.</param>
        /// <param name="detachedCriteria">The detached criteria.</param>
        /// <returns></returns>
        public static IList<MKtPubcVoteHistory> SelectALLSliced(int firstResult, int maxResult, Order[] orders, DetachedCriteria detachedCriteria)
        {
            return (IList<MKtPubcVoteHistory>)SlicedFindAll(typeof(MKtPubcVoteHistory), firstResult, maxResult, orders, detachedCriteria);
        }
        /// <summary>
        /// Selects the ALL sliced.
        /// </summary>
        /// <param name="firstResult">The first result.</param>
        /// <param name="maxResult">The max result.</param>
        /// <param name="orders">The orders.</param>
        /// <param name="criteria">The criteria.</param>
        /// <returns></returns>
        public static IList<MKtPubcVoteHistory> SelectALLSliced(int firstResult, int maxResult, Order[] orders, params ICriterion[] criteria)
        {
            return (IList<MKtPubcVoteHistory>)SlicedFindAll(typeof(MKtPubcVoteHistory), firstResult, maxResult, orders, criteria);
        }

        /// <summary>
        /// Countses this instance.
        /// </summary>
        /// <returns></returns>
        public static int Counts()
        {
            return Count(typeof(MKtPubcVoteHistory));
        }
        /// <summary>
        /// Countses the specified detached criteria.
        /// </summary>
        /// <param name="detachedCriteria">The detached criteria.</param>
        /// <returns></returns>
        public static int Counts(DetachedCriteria detachedCriteria)
        {
            return Count(typeof(MKtPubcVoteHistory), detachedCriteria);
        }
        /// <summary>
        /// Countses the specified criteria.
        /// </summary>
        /// <param name="criteria">The criteria.</param>
        /// <returns></returns>
        public static int Counts(params ICriterion[] criteria)
        {
            return Count(typeof(MKtPubcVoteHistory), criteria);
        }


        /// <summary>
        /// Exists the specified id.
        /// </summary>
        /// <param name="id">The id.</param>
        /// <returns></returns>
        public static bool Exist(object id)
        {
            return Exists(typeof(MKtPubcVoteHistory), id);
        }
        /// <summary>
        /// Exists the specified id.
        /// </summary>
        /// <param name="id">The id.</param>
        /// <param name="detachedCriteria">The detached criteria.</param>
        /// <returns></returns>
        public static bool Exist(DetachedCriteria detachedCriteria)
        {
            return Exists(typeof(MKtPubcVoteHistory), detachedCriteria);
        }
        /// <summary>
        /// Exists the specified id.
        /// </summary>
        /// <param name="id">The id.</param>
        /// <param name="criteria">The criteria.</param>
        /// <returns></returns>
        public static bool Exist(params ICriterion[] criteria)
        {
            return Exists(typeof(MKtPubcVoteHistory), criteria);
        }
        protected override void OnDelete()
        {
            DeleteTime = DateTime.Now;
            base.OnDelete();
        }





        /// <summary>
        /// Gets or sets the ID.(ID)
        /// </summary>
        /// <value>The ID.</value>
        /// <remarks>
        /// ID
        /// </remarks>
        [PrimaryKey(PrimaryKeyType.Native, "ID"),
        ValidateNonEmpty("ID不能为空"),
        ValidateRange(0, 2147483647, "ID的值要在0到2147483647之间"),
        ]
        public int? ID
        {
            get
            {
                return _ID;
            }
            set
            {
                _ID = value;
            }
        }


        /// <summary>
        /// Gets or sets the BoardNO.(BoardNO)
        /// </summary>
        /// <value>The BoardNO.</value>
        /// <remarks>
        /// BoardNO
        /// </remarks>
        [Property("BOARD_NO"),
        ValidateRange(0, 2147483647, "BoardNO的值要在0到2147483647之间"),
        ]
        public int? BoardNO
        {
            get
            {
                return _BoardNO;
            }
            set
            {
                _BoardNO = value;
            }
        }


        /// <summary>
        /// Gets or sets the ItemNO.(ItemNO)
        /// </summary>
        /// <value>The ItemNO.</value>
        /// <remarks>
        /// ItemNO
        /// </remarks>
        [Property("ITEM_NO"),
        ValidateRange(0, 2147483647, "ItemNO的值要在0到2147483647之间"),
        ]
        public int? ItemNO
        {
            get
            {
                return _ItemNO;
            }
            set
            {
                _ItemNO = value;
            }
        }


        /// <summary>
        /// Gets or sets the DateCur.(DateCur)
        /// </summary>
        /// <value>The DateCur.</value>
        /// <remarks>
        /// DateCur
        /// </remarks>
        [Property("DATE_CUR"),
        ]
        public DateTime? DateCur
        {
            get
            {
                return _DateCur;
            }
            set
            {
                _DateCur = value;
            }
        }


        /// <summary>
        /// Gets or sets the CycNO.(CycNO)
        /// </summary>
        /// <value>The CycNO.</value>
        /// <remarks>
        /// CycNO
        /// </remarks>
        [Property("CYC_NO"),
        ValidateRange(0, 2147483647, "CycNO的值要在0到2147483647之间"),
        ]
        public int? CycNO
        {
            get
            {
                return _CycNO;
            }
            set
            {
                _CycNO = value;
            }
        }


        /// <summary>
        /// Gets or sets the INDEX1.(INDEX1)
        /// </summary>
        /// <value>The INDEX1.</value>
        /// <remarks>
        /// INDEX1
        /// </remarks>
        [Property("INDEX1"),
        ]
        public decimal INDEX1
        {
            get
            {
                return _INDEX1;
            }
            set
            {
                _INDEX1 = value;
            }
        }


        /// <summary>
        /// Gets or sets the INDEX2.(INDEX2)
        /// </summary>
        /// <value>The INDEX2.</value>
        /// <remarks>
        /// INDEX2
        /// </remarks>
        [Property("INDEX2"),
        ]
        public decimal INDEX2
        {
            get
            {
                return _INDEX2;
            }
            set
            {
                _INDEX2 = value;
            }
        }


        /// <summary>
        /// Gets or sets the INDEX3.(INDEX3)
        /// </summary>
        /// <value>The INDEX3.</value>
        /// <remarks>
        /// INDEX3
        /// </remarks>
        [Property("INDEX3"),
        ]
        public decimal INDEX3
        {
            get
            {
                return _INDEX3;
            }
            set
            {
                _INDEX3 = value;
            }
        }


        /// <summary>
        /// Gets or sets the INDEX4.(INDEX4)
        /// </summary>
        /// <value>The INDEX4.</value>
        /// <remarks>
        /// INDEX4
        /// </remarks>
        [Property("INDEX4"),
        ]
        public decimal INDEX4
        {
            get
            {
                return _INDEX4;
            }
            set
            {
                _INDEX4 = value;
            }
        }


        /// <summary>
        /// Gets or sets the INDEX5.(INDEX5)
        /// </summary>
        /// <value>The INDEX5.</value>
        /// <remarks>
        /// INDEX5
        /// </remarks>
        [Property("INDEX5"),
        ]
        public decimal INDEX5
        {
            get
            {
                return _INDEX5;
            }
            set
            {
                _INDEX5 = value;
            }
        }


        /// <summary>
        /// Gets or sets the INDEX6.(INDEX6)
        /// </summary>
        /// <value>The INDEX6.</value>
        /// <remarks>
        /// INDEX6
        /// </remarks>
        [Property("INDEX6"),
        ]
        public decimal INDEX6
        {
            get
            {
                return _INDEX6;
            }
            set
            {
                _INDEX6 = value;
            }
        }


        /// <summary>
        /// Gets or sets the INDEX7.(INDEX7)
        /// </summary>
        /// <value>The INDEX7.</value>
        /// <remarks>
        /// INDEX7
        /// </remarks>
        [Property("INDEX7"),
        ]
        public decimal INDEX7
        {
            get
            {
                return _INDEX7;
            }
            set
            {
                _INDEX7 = value;
            }
        }


        /// <summary>
        /// Gets or sets the INDEX8.(INDEX8)
        /// </summary>
        /// <value>The INDEX8.</value>
        /// <remarks>
        /// INDEX8
        /// </remarks>
        [Property("INDEX8"),
        ]
        public decimal INDEX8
        {
            get
            {
                return _INDEX8;
            }
            set
            {
                _INDEX8 = value;
            }
        }


        /// <summary>
        /// Gets or sets the INDEX9.(INDEX9)
        /// </summary>
        /// <value>The INDEX9.</value>
        /// <remarks>
        /// INDEX9
        /// </remarks>
        [Property("INDEX9"),
        ]
        public decimal INDEX9
        {
            get
            {
                return _INDEX9;
            }
            set
            {
                _INDEX9 = value;
            }
        }


        /// <summary>
        /// Gets or sets the INDEX10.(INDEX10)
        /// </summary>
        /// <value>The INDEX10.</value>
        /// <remarks>
        /// INDEX10
        /// </remarks>
        [Property("INDEX10"),
        ]
        public decimal INDEX10
        {
            get
            {
                return _INDEX10;
            }
            set
            {
                _INDEX10 = value;
            }
        }


        /// <summary>
        /// Gets or sets the INDEX11.(INDEX11)
        /// </summary>
        /// <value>The INDEX11.</value>
        /// <remarks>
        /// INDEX11
        /// </remarks>
        [Property("INDEX11"),
        ]
        public decimal INDEX11
        {
            get
            {
                return _INDEX11;
            }
            set
            {
                _INDEX11 = value;
            }
        }


        /// <summary>
        /// Gets or sets the INDEX12.(INDEX12)
        /// </summary>
        /// <value>The INDEX12.</value>
        /// <remarks>
        /// INDEX12
        /// </remarks>
        [Property("INDEX12"),
        ]
        public decimal INDEX12
        {
            get
            {
                return _INDEX12;
            }
            set
            {
                _INDEX12 = value;
            }
        }


        /// <summary>
        /// Gets or sets the INDEX13.(INDEX13)
        /// </summary>
        /// <value>The INDEX13.</value>
        /// <remarks>
        /// INDEX13
        /// </remarks>
        [Property("INDEX13"),
        ]
        public decimal INDEX13
        {
            get
            {
                return _INDEX13;
            }
            set
            {
                _INDEX13 = value;
            }
        }


        /// <summary>
        /// Gets or sets the INDEX14.(INDEX14)
        /// </summary>
        /// <value>The INDEX14.</value>
        /// <remarks>
        /// INDEX14
        /// </remarks>
        [Property("INDEX14"),
        ]
        public decimal INDEX14
        {
            get
            {
                return _INDEX14;
            }
            set
            {
                _INDEX14 = value;
            }
        }


        /// <summary>
        /// Gets or sets the INDEX15.(INDEX15)
        /// </summary>
        /// <value>The INDEX15.</value>
        /// <remarks>
        /// INDEX15
        /// </remarks>
        [Property("INDEX15"),
        ]
        public decimal INDEX15
        {
            get
            {
                return _INDEX15;
            }
            set
            {
                _INDEX15 = value;
            }
        }


        /// <summary>
        /// Gets or sets the INDEX16.(INDEX16)
        /// </summary>
        /// <value>The INDEX16.</value>
        /// <remarks>
        /// INDEX16
        /// </remarks>
        [Property("INDEX16"),
        ]
        public decimal INDEX16
        {
            get
            {
                return _INDEX16;
            }
            set
            {
                _INDEX16 = value;
            }
        }


        /// <summary>
        /// Gets or sets the INDEX17.(INDEX17)
        /// </summary>
        /// <value>The INDEX17.</value>
        /// <remarks>
        /// INDEX17
        /// </remarks>
        [Property("INDEX17"),
        ]
        public decimal INDEX17
        {
            get
            {
                return _INDEX17;
            }
            set
            {
                _INDEX17 = value;
            }
        }


        /// <summary>
        /// Gets or sets the INDEX18.(INDEX18)
        /// </summary>
        /// <value>The INDEX18.</value>
        /// <remarks>
        /// INDEX18
        /// </remarks>
        [Property("INDEX18"),
        ]
        public decimal INDEX18
        {
            get
            {
                return _INDEX18;
            }
            set
            {
                _INDEX18 = value;
            }
        }


        /// <summary>
        /// Gets or sets the INDEX19.(INDEX19)
        /// </summary>
        /// <value>The INDEX19.</value>
        /// <remarks>
        /// INDEX19
        /// </remarks>
        [Property("INDEX19"),
        ]
        public decimal INDEX19
        {
            get
            {
                return _INDEX19;
            }
            set
            {
                _INDEX19 = value;
            }
        }


        /// <summary>
        /// Gets or sets the INDEX20.(INDEX20)
        /// </summary>
        /// <value>The INDEX20.</value>
        /// <remarks>
        /// INDEX20
        /// </remarks>
        [Property("INDEX20"),
        ]
        public decimal INDEX20
        {
            get
            {
                return _INDEX20;
            }
            set
            {
                _INDEX20 = value;
            }
        }


        /// <summary>
        /// Gets or sets the INDEXTOTAL.(INDEXTOTAL)
        /// </summary>
        /// <value>The INDEXTOTAL.</value>
        /// <remarks>
        /// INDEXTOTAL
        /// </remarks>
        [Property("INDEXTOTAL"),
        ]
        public decimal INDEXTOTAL
        {
            get
            {
                return _INDEXTOTAL;
            }
            set
            {
                _INDEXTOTAL = value;
            }
        }


        /// <summary>
        /// Gets or sets the IsValidate.(IsValidate)
        /// </summary>
        /// <value>The IsValidate.</value>
        /// <remarks>
        /// IsValidate
        /// </remarks>
        [Property("IS_VALIDATE"),
        ValidateRange(0, 2147483647, "IsValidate的值要在0到2147483647之间"),
        ]
        public int? IsValidate
        {
            get
            {
                return _IsValidate;
            }
            set
            {
                _IsValidate = value;
            }
        }


        /// <summary>
        /// Gets or sets the InputTime.(InputTime)
        /// </summary>
        /// <value>The InputTime.</value>
        /// <remarks>
        /// InputTime
        /// </remarks>
        [Property("INPUT_TIME"),
        ]
        public DateTime? InputTime
        {
            get
            {
                return _InputTime;
            }
            set
            {
                _InputTime = value;
            }
        }


        /// <summary>
        /// Gets or sets the ModifyTime.(ModifyTime)
        /// </summary>
        /// <value>The ModifyTime.</value>
        /// <remarks>
        /// ModifyTime
        /// </remarks>
        [Property("MODIFY_TIME"),
        ]
        public DateTime? ModifyTime
        {
            get
            {
                return _ModifyTime;
            }
            set
            {
                _ModifyTime = value;
            }
        }


        /// <summary>
        /// Gets or sets the DeleteTime.(DeleteTime)
        /// </summary>
        /// <value>The DeleteTime.</value>
        /// <remarks>
        /// DeleteTime
        /// </remarks>
        [Property("DELETE_TIME"),
        ]
        public DateTime? DeleteTime
        {
            get
            {
                return _DeleteTime;
            }
            set
            {
                _DeleteTime = value;
            }
        }



        private int? _ID;

        private int? _BoardNO;

        private int? _ItemNO;

        private DateTime? _DateCur;

        private int? _CycNO;

        private decimal _INDEX1;

        private decimal _INDEX2;

        private decimal _INDEX3;

        private decimal _INDEX4;

        private decimal _INDEX5;

        private decimal _INDEX6;

        private decimal _INDEX7;

        private decimal _INDEX8;

        private decimal _INDEX9;

        private decimal _INDEX10;

        private decimal _INDEX11;

        private decimal _INDEX12;

        private decimal _INDEX13;

        private decimal _INDEX14;

        private decimal _INDEX15;

        private decimal _INDEX16;

        private decimal _INDEX17;

        private decimal _INDEX18;

        private decimal _INDEX19;

        private decimal _INDEX20;

        private decimal _INDEXTOTAL;

        private int? _IsValidate;

        private DateTime? _InputTime;

        private DateTime? _ModifyTime;

        private DateTime? _DeleteTime;


    }
}
